<template>
  <div class="main">
    <el-dialog
      title="提示"
      :visible.sync="dialogVisible"
      width="55%"
      :before-close="handleClose"
    >
      <div>
        <el-row>
          <el-col :span="6"> 【题型】{{ arrAlr.questionType }} </el-col>
          <el-col :span="6"> 【编号】{{ arrAlr.id }} </el-col>
          <el-col :span="6"> 【难度】{{ arrAlr.difficulty }} </el-col>
          <el-col :span="6"> 【标签】{{ arrAlr.tags }} </el-col>
          <el-col :span="24"> <br /> </el-col>
          <el-col :span="6"> 【学科】{{ arrAlr.subject }} </el-col>
          <el-col :span="6"> 【目录】{{ arrAlr.catalog }} </el-col>
          <el-col :span="6"> 【方向】{{ arrAlr.direction }} </el-col>
          <el-col :span="24"></el-col>
        </el-row>
        <hr />
        <el-row>
          <el-col :span="24"> </el-col>
          <el-col :span="24"> 【题干】</el-col>
          <el-col :span="24"> <br /></el-col>
          <el-col :span="24">
            <span v-html="arrAlr.question"></span>
          </el-col>
          <el-col :span="24"> <br /></el-col>
          <el-col :span="24">
            <span>多选题 选项：（以下选中的选项为正确答案）</span>
          </el-col>
          <el-col :span="24"> <br /></el-col>
          <el-col :span="24">
            <el-checkbox-group v-model="checkList">
              <el-checkbox label="复选框 A"></el-checkbox>
            </el-checkbox-group>
          </el-col>
          <el-col :span="24"><hr /> </el-col>
          <el-col :span="24">
            【参考答案】：
            <el-button type="danger" @click="previewEle">
              视频答案预览
            </el-button>
          </el-col>
          <el-col :span="24">
            <video
              v-if="showVideoEle"
              class="videoEle"
              controls
              preload="auto"
              :src="arrAlr.videoURL"
            ></video>
          </el-col>
          <el-col :span="24"><hr /> </el-col>
          <el-col :span="24"> <br /></el-col>
          <el-col :span="24" v-html="`【答案解析】：${arrAlr.answer}`">
          </el-col>
          <el-col :span="24"> <br /></el-col>
          <el-col :span="24"><hr /> </el-col>
          <el-col :span="24"> <br /></el-col>
          <el-col :span="24"> 【题目备注】：{{ arrAlr.remarks }}</el-col>
          <el-col :span="24"> <br /></el-col>
          <el-col :span="24"><hr /> </el-col>
        </el-row>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="handleClose"> 关 闭 </el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
export default {
  props: {
    dialogVisible: {
      type: Boolean
    },
    arrAlr: {
      type: Object
    }
  },
  data() {
    return {
      checkList: ['复选框 A'],
      showVideoEle: false
    }
  },
  methods: {
    handleClose() {
      this.$emit('update:dialogVisible', false)
      this.showVideoEle = false
      // this.$confirm('确认关闭？')
      //   .then((_) => {

      //   })
      //   .catch((_) => {})
    },
    previewEle() {
      this.showVideoEle = !this.showVideoEle
    }
  }
}
</script>
<style scoped lang="scss">
.main {
  ::v-deep {
    .el-dialog {
      border-radius: 5px;
    }
  }
}
.videoEle {
  width: 400px;
  height: 300px;
}
</style>
